// pages/order/replaceCustomerOrder/index.js
Page({

  data: {
    active: 0,
    customerName: "请选择"
  },

  onShow() {
    let customerName = wx.getStorageSync("custName");
    console.log(customerName)
    let data = customerName != '' ? customerName : "请选择"
    this.setData({
      customerName: data
    })
  },

  onChange(e) {
    // 获取下标e.detail.index;  0:订货单；1:退货单
  },

  goGoodsList() {
    const custId = wx.getStorageSync('custId')
    if (!custId) {
      wx.showToast({
        title: '请先选择客户名称',
        icon: 'none'
      })
      return;
    }
    wx.navigateTo({
      url: '../../goods/goodsList/index',
    })
  },

  handleScanCode() {
    wx.scanCode({
      success(res) {
        wx.showToast({
          icon: "none",
          duration: 2000,
          title: '仅为测试功能~',
        })
      }
    })
  },

})